program PROB007;
const
  max = 10001;
var
  p : array[1..max] of longint;
  l, i : longint;

function prime(k : longint) : boolean;
var
  i, c : longint;
begin
  prime := false;
  c := trunc(sqrt(k));
  for i := 1 to l do
  begin
    if p[i] > c then break;
    if k mod p[i] = 0 then exit;
  end;
  prime := true;
end;

begin
  l := 0;
  for i := 2 to 1000000 do
    if prime(i) then
    begin
      inc(l);
      p[l] := i;
      if l = max then break;
    end;
  writeln(p[max]);
end.
